using System.Data.Entity.ModelConfiguration;
using Core.Model;

namespace Infrastructure.Configurations
{
    internal class AccountConfiguration : EntityTypeConfiguration<Account>
    {
        public AccountConfiguration()
        {
            HasKey(p => p.UserId);
            HasOptional(c => c.Category);
            Property(p => p.UserId).HasMaxLength(20).IsRequired();
            Property(p => p.Email).HasMaxLength(80).IsRequired();
            Property(p => p.FirstName).HasMaxLength(80).IsRequired();
            Property(p => p.LastName).HasMaxLength(80).IsRequired();
            Property(p => p.Address1).HasMaxLength(80).IsRequired();
            Property(p => p.Address2).HasMaxLength(80).IsOptional();
            Property(p => p.City).HasMaxLength(80).IsRequired();
            Property(p => p.State).HasMaxLength(20).IsRequired();
            Property(p => p.Country).HasMaxLength(20).IsRequired();
            Property(p => p.Phone).HasMaxLength(20).IsRequired();
            Property(p => p.Language).HasMaxLength(80).IsRequired();
            Property(p => p.Password).HasMaxLength(20).IsRequired();
          

        }
    }
}